package com.longge;

public class FindSpecialInteger {

    public int findSpecialInteger(int[] arr) {

        int count = 1, ans = arr[0];
        int maxCount = arr.length / 4 + 1;
        for (int i = 1; i < arr.length; i++) {
            if (ans==arr[i]){
                count++;
            }else {
                count=1;
                ans = arr[i];
            }
            if (count == maxCount) return ans;
        }
        return ans;


    }

}
